<template>
  <div class="box">
    <div class="hotCommentBox" v-if="commentList&&commentList.hotComments">
      <!-- <div class="ad">精彩评论</div> -->
      <div class="hotComments" v-for="(item,index) in commentList.hotComments" :key="index">
        <div class="a_box" v-if="item&&item.user&&item.user.avatarUrl">
          <img :src="item.user.avatarUrl" alt="">
        </div>
        <div class="contents_box">
          <div class="nickName">
            {{item.user.nickname}}
            <i v-if="item.user.vipRights&&item.user.vipRights.associator&&item.user.vipRights.associator.rights" class="vipPic"> <img src="//p6.music.126.net/obj/wo3DlcOGw6DClTvDisK1/4213922817/9124/a83c/7eb7/6d7d81b608bfb56d7fb286bd8eb72346.png" alt=""> </i>

          </div>
          <div class="times">
            {{item.timeStr}}
          </div>
          <div class="content">
            {{item.content}}
          </div>
          <div class="repied" v-for="(item2,index) in item.beReplied" :key="index">
            <span class="repiedContent" v-if="item&&item.beReplied">
              <span style="color:#507daf">{{item2.user.nickname}}</span> :{{item2.content}}
            </span>
          </div>
          <i class="iconfont icon"><span>{{item.likedCount}}</span><van-icon name="thumb-circle-o"></van-icon></i>
        </div>
      </div>
    </div>

    <div class="newCommentBox" v-if="commentList&&commentList.comments">
      <div class="ad">最新评论</div>
      <div class="newComments" v-for="(item,index) in commentList.comments" :key="index">
        <div class="a_box">
          <img :src="item.user.avatarUrl" alt="">
        </div>
        <div class="contents_box">
          <div class="nickName">
            {{item.user.nickname}}
            <i v-if="item.user.vipRights&&item.user.vipRights.associator&&item.user.vipRights.associator.rights" class="vipPic"> <img src="//p6.music.126.net/obj/wo3DlcOGw6DClTvDisK1/4213922817/9124/a83c/7eb7/6d7d81b608bfb56d7fb286bd8eb72346.png" alt=""> </i>
          </div>
          <div class="times">
            {{item.timeStr}}
          </div>
          <div class="content">
            {{item.content}}
          </div>
          <div class="repied" v-for="(item2,index) in item.beReplied" :key="index">
            <span class="repiedContent" v-if="item.beReplied">
              <span style="color:#507daf">{{item2.user.nickname}}</span> :{{item2.content}}
            </span>
          </div>
          <i class="iconfont icon"><span>{{item.likedCount}}</span>&#xec7f;</i>
        </div>
      </div>
      <div v-if="commentList.more" class="loadMore" style="">查看全部{{commentList.total}}条评论 <i class="arrow"></i></div>

    </div>

  </div>
</template>

<script>
export default {
  props: {
    commentList: [Object, Array, String]
  },
  created () {}
}
</script>

<style lang='less' scoped>
.box{
  border-top: 1px solid red;

}
.vipPic {
  img {
    width: 30px;
    height: 11px;
  }
}
.loadMore {
  color: #a6a6a6;
  text-align: center;
  background-color: #ffffff;
  line-height: 48px;
}
.arrow {
  display: inline-block;
  background: url()
    no-repeat;
  width: 10px;
  height: 10px;
  background-position: center;
  background-size: contain;
}
// .content {
//   // overflow: hidden;
//   // text-overflow: ellipsis;
//   // white-space: nowrap;
// }
.ad {
  font-size: 14px;
  padding-left: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
}
.hotComments,
.newComments {
  background-color: #fff;
  display: flex;
  padding-top: 10px;
  .a_box {
    padding: 0 10px;
    img {
      width: 30px;
      height: 30px;
      border-radius: 15px;
    }
  }
  .contents_box {
    position: relative;
    width: 86%;
    border-bottom: 1px solid #e2e3f0;
    padding-bottom: 20px;
    .nickName {
      margin-bottom: 8px;
      font-size: 20px;
    }
    .times {
      color: #adaebd;
      margin-bottom: 10px;
      font-size: 17px
    }
    .content{
        font-size: 14px;
      }
    .repied {
      width: 260px;
      border: 1px solid #f2f2f2;
      padding: 10px;
      margin-top: 10px;
      .repiedContent {
        line-height: 30px;
      }

    }
    .icon {
      position: absolute;
      top: 0;
      right: 10px;
      font-size: 16px;
      color: #999999;
      span {
        font-size: 13px;
      }
    }
  }
}
</style>
